#include "WeirdEngine.h"

class TerrainDemo : public Weird::RenderApplication
{
public:
	TerrainDemo(){ strcpy( m_szWindowName, "TerrainDemo"); strcpy( m_szWindowTile, "TerrainDemo" ); }

protected:
	virtual void	Initialize( void* pCmd )
	{
		__super::Initialize( pCmd );
	
		m_pGfxSystem	= new GfxSystem();
		m_pGfxScene		= m_pGfxSystem->CreateScene();
		m_pTerrain		= m_pGfxSystem->CreateObject( EGfxObject_Terrain );

		m_pGfxScene->AttachObject( m_pTerrain );
	}

	virtual void	_OnTick()
	{
		m_pGfxScene->RenderScene();
	}

	virtual void	Release()
	{
		delete m_pGfxSystem;
	}

protected:
	GfxSystem*		m_pGfxSystem;
	GfxScene*		m_pGfxScene;
	GfxObject*		m_pTerrain;
};

INT APIENTRY WinMain(HINSTANCE hInstance,
					   HINSTANCE hPrevInstance,
					   LPTSTR    lpCmdLine,
					   INT       nCmdShow)
{
	TerrainDemo demo;
	demo.Initialize( lpCmdLine );
	demo.Run();
	demo.Release();
	return 0;
}